package com.etc.service.impl;

import com.etc.entity.Question;
import com.etc.entity.Questionnaire;
import com.etc.mapper.QuestionnaireMapper;
import com.etc.service.QuestionnaireService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QuestionaireImpl implements QuestionnaireService{
    @Autowired
    private QuestionnaireMapper questionnaireMapper;



    @Override
    public Questionnaire query() {
        Questionnaire questionnaire = questionnaireMapper.querybyID(1);
        System.out.println("hello  QuestionaireImpl");
        return questionnaire;
    }

    @Override
    public List<Questionnaire> querybyAll() {
        return questionnaireMapper.querybyAll();
    }

    @Override
    public List<Question> queryquestion() {
        return questionnaireMapper.queryquestion();
    }

    @Override
    public void insertQ(int id, String answer) {
        questionnaireMapper.insertQ(id,answer);
    }
}
